﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Diagnostics;
using PetriNetSharp.Engine;

namespace PetriNetSharp.Converter
{
	/// <summary>
	/// Converter for getting the tool tip text for a place
	/// </summary>
	/// <remarks>
	/// While have to change tokens later for when a graph is running
	/// </remarks>
	public class PlaceToToolTipTextValueConverter : IValueConverter
	{
		/// <summary>
		/// Convert a Place object to a tool tip text string in the format:
		/// Tokens: #
		/// </summary>
		/// <param name="value">The number of tokens the palce currently has</param>
		/// <param name="targetType">Not used</param>
		/// <param name="parameter">Not used</param>
		/// <param name="culture"><Not used/param>
		/// <returns>The Tool Tip text string for the passed Place</returns>
		object IValueConverter.Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			int tokens = (int)value;
			Place place = value as Place;
			string tip = "";
			tip = String.Format("Tokens: {0}", tokens);

			return tip;
		}

		/// <summary>
		/// Not implemented
		/// </summary>
		/// <param name="value">Not implemented</param>
		/// <param name="targetType">Not implemented</param>
		/// <param name="parameter">Not implemented</param>
		/// <param name="culture">Not implemented</param>
		/// <returns>Not implemented</returns>
		object IValueConverter.ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			throw new NotImplementedException();
		}

	}
}
